@extends('layout.admin')
@section('content')<!-- BEGIN PAGE TITLE-->
<h1 class="page-title"> 文章列表
    <small>文章管理</small>
</h1>
<!-- END PAGE TITLE-->
<!-- END PAGE HEADER-->
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN SAMPLE TABLE PORTLET-->
        <div class="portlet light bordered">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-social-dribbble font-green"></i>
                    <span class="caption-subject font-green bold uppercase">查看文章</span>
                </div>
                <div class="actions">
                    <a href="{{ route('admin.article.add') }}" class="btn btn-outline btn-circle btn-sm green">
                        <i class="fa fa-edit"></i> 发布文章
                    </a>
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-scrollable">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th> # </th>
                            <th> 标题 </th>
                            <th> 作者 </th>
                            <th> 发布时间 </th>
                            <th> 更新时间 </th>
                            <th> 操作 </th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($articles as $article)
                            <tr>
                                <td> {{ $article->id }} </td>
                                <td> {{ $article->title }} </td>
                                <td> {{ $article->user_name }} </td>
                                <td> {{ $article->created_at }} </td>
                                <td> {{ $article->updated_at }} </td>
                                <td>
                                    <div class="btn-group">
                                        <a href="{{ route('admin.article.edit', ['id' => $article->id]) }}" class="btn btn-default">编辑</a>
                                        <a href="{{ route('archives.details', ['id' => $article->id]) }}" class="btn btn-default" target="_blank">查看</a>
                                        <a href="{{ route('admin.article.del', ['id' => $article->id]) }}" class="btn btn-default">删除</a>
                                    </div>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-md-5 col-sm-5">
                        <div class="dataTables_info" id="sample_editable_1_info" role="status" aria-live="polite">
                            当前第 {{ $articles->currentPage() }} 页，共 {{ $articles->total() }} 篇文章
                        </div>
                    </div>
                    <div class="col-md-7 col-sm-7">
                        <div class="dataTables_paginate paging_bootstrap_number" id="sample_editable_1_paginate">
                            {{ $articles->links() }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END SAMPLE TABLE PORTLET-->
    </div>
</div>

@endsection()
